﻿
using System.Collections.Generic;

namespace WzhModule.GM
{

    public abstract class WzhGMMenu
    {

        public WzhGMContent GMContent;
        public WzhGMPanel GMPanel;


        public List<string> Labels = new List<string>();

        public List<WzhGMSliderField> Slider = new List<WzhGMSliderField>();

        public int Sequence;

        public string string_TextValue
        {
            get
            {
                if (GMContent == null)
                {
                    return "";
                }
                if (GMContent.textInputField == null)
                {
                    return "";
                }

                return GMContent.textInputField.text;
            }

        }

        public int int_TextValue
        {
            get
            {
                if (string.IsNullOrEmpty(string_TextValue))
                {
                    return int.MinValue;
                }

                if (int.TryParse(string_TextValue, out int value))
                {
                    return value;
                }

                return int.MinValue;

            }
        }

        public virtual void Init()
        {

        }

        public virtual void OnUpdate()
        {

        }

        public virtual void OnDispose()
        {

        }

    }

}
